﻿using System.Data.Entity;
using Microsoft.Practices.Unity;
using StoreDemo.Data.Repository;
using StoreDemo.Domain.Data;

namespace StoreDemo.Data
{
    public static class Bootstrapper
    {
        public static void RegisterDependecies(IUnityContainer unityContainer)
        {
            unityContainer.RegisterType<IDatabaseContextFactory, DatabaseContextFactory>();
            unityContainer.RegisterType<IDatabaseInitializer<StoreDemoDatabaseContext>, DatabaseInitializer>();
            unityContainer.RegisterType<IUnitOfWorkFactory, UnitOfWorkFactory>(new ContainerControlledLifetimeManager());
        }
    }
}